package cate.game.event.crossboss;

import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;
import easy.java.time.DateTool;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.StringJoiner;

@NoArgsConstructor
@Data
@NoteClass(value = "跨服BOSS 定时器任务配置")
public class CrossBossTimerTaskSettings {
    @NoteField(value = "唯一ID")
    private int id;
    @NoteField(value = "触发时间")
    private long triggerTimeMs;
    @NoteField(value = "定时器事件类型")
    private CrossBossTimerEventType eventType;

    public static CrossBossTimerTaskSettings of(long triggerTimeMs, CrossBossTimerEventType eventType) {
        CrossBossTimerTaskSettings settings = new CrossBossTimerTaskSettings();
        settings.setTriggerTimeMs(triggerTimeMs);
        settings.setEventType(eventType);
        return settings;
    }

    @Override
    public String toString() {
        return new StringJoiner(", ", CrossBossTimerTaskSettings.class.getSimpleName() + "[", "]")
                .add("id=" + id)
                .add("triggerTime=" + DateTool.instance().format(triggerTimeMs))
                .add("eventType=" + eventType)
                .toString();
    }
}
